package com.jk.controller;

import com.jk.dto.TbAdmin;
import com.jk.interfaces.TbAdminServiceApi;
import com.jk.pojo.PagedResponse;
import com.jk.service.TbAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yzf
 * @version 1.0
 * @description: TODO
 * @date 2024/12/9 17:29
 */
@RestController
public class TbAdminController implements TbAdminServiceApi {
    @Autowired
    private TbAdminService tbAdminService;

    @Override
    public PagedResponse<TbAdmin> findTbAdminList(TbAdmin tbAdmin, Integer pageNum, Integer pageSize) {
        return tbAdminService.findTbAdminList(tbAdmin, pageNum, pageSize);
    }

    @Override
    public void addTbAdmin(TbAdmin tbAdmin) {
        tbAdminService.addTbAdmin(tbAdmin);
    }

    @Override
    public TbAdmin findTbAdminByUserName(String username) {
        return tbAdminService.findTbAdminByUserName(username);
    }

    @Override
    public void deleteTbAdminById(Integer id) {
        tbAdminService.deleteTbAdminById(id);
    }

    @Override
    public TbAdmin getTbAdminById(Integer id) {
        return tbAdminService.getTbAdminById(id);
    }

    @Override
    public void upTbAdmin(TbAdmin tbAdmin) {
        tbAdminService.upTbAdmin(tbAdmin);
    }

    @Override
    public void upstatus(TbAdmin tbAdmin) {
        tbAdminService.upstatus(tbAdmin);
    }

    @Override
    public void updatestatus(TbAdmin tbAdmin) {
        tbAdminService.updatestatus(tbAdmin);
    }

    @Override
    public List<String> selectPermsByUserId(Integer id) {
        return tbAdminService.selectPermsByUserId(id);
    }
}
